require("home")

setting = {}


function setting.Init() 
    local ts = require("ts")
    local cjson = ts.json
    w,h = getScreenSize();
    MyTable = {
        ["style"]  = "default",
        ["rettype"] = "table",
        ["width"] = w,
        ["height"] = h,
        ["orient"] = "0",
        ["bgcolor"] = "255,255,255",
        ["btnbkcolor"] = "255,255,255",
        ["config"] = "",
        ["pagetype"] = "multi",
        ["selpage"] = "1",
        ["pagenumtype"] = "dot",
        ["titles"] = "初始化配置",
        ["timer"] = "0",
        ["cancelname"] = "取消",
        ["okname"] = "确定",
        ["titlealign"] = "left",
        pages=
        {
            {
                              
                {
                    ["type"] = "Label",
                    ["color"] = "38,38,38",
                    ["size"] = "15",
                    ["align"] = "left",
                    ["text"] = "直播间id",
                },
                {
                    ["type"] = "Edit",
                    ["color"] = "38,38,38",
                    ["prompt"] = "请输入直播间id",
                    ["size"] = "15",
                    ["id"] = "videoId",
                    ["align"] = "left",
                    ["text"] = "",
                    ["kbtype"] = "default",
                    },},
        },
                  
    } 
    local MyJsonString = cjson.encode(MyTable);
    UIret,values = showUI(MyJsonString)
    
    -- 点击确定
    if values and UIret == 1 then 
        local videoId = values["videoId"]
        home.isFontShow(videoId)
    else
        toast("请重新运行输入配置的抖音账号id")
    end
end 

return setting